package com.pubinfo.passbook.common.config;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;

import java.util.List;

/**
 * mybatis-plus批量插入重写
 */
public class CxmSqlInjector extends DefaultSqlInjector {
  
  @Override
  public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
    // 防止父类的方法不可使用
    List<AbstractMethod> methodList = super.getMethodList(mapperClass);
    // 添加批量插入的方法
    methodList.add(new InsertBatchSomeColumn());
    return methodList;
  }
  
}